
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpQuartzLog.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpQuartzLogForm"
 */
public class CcpQuartzLogForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cqlGuid = null;
   private java.lang.String _sessionId = null;
   private java.lang.String _cqrGuid = null;
   private java.lang.String _logType = null;
   private java.lang.String _logContent = null;
   private java.lang.String _logTime = null;

   /**
    * Standard constructor.
    */
   public CcpQuartzLogForm() {
   }

   /**
    * Returns the cqlGuid
    *
    * @return the cqlGuid
    */
   public java.lang.String getCqlGuid() {
      return _cqlGuid;
   }

   /**
    * Sets the cqlGuid
    *
    * @param cqlGuid the new cqlGuid value
    */
   public void setCqlGuid(java.lang.String cqlGuid) {
      _cqlGuid = cqlGuid;
   }
   /**
    * Returns the sessionId
    *
    * @return the sessionId
    */
   public java.lang.String getSessionId() {
      return _sessionId;
   }

   /**
    * Sets the sessionId
    *
    * @param sessionId the new sessionId value
    */
   public void setSessionId(java.lang.String sessionId) {
      _sessionId = sessionId;
   }
   /**
    * Returns the cqrGuid
    *
    * @return the cqrGuid
    */
   public java.lang.String getCqrGuid() {
      return _cqrGuid;
   }

   /**
    * Sets the cqrGuid
    *
    * @param cqrGuid the new cqrGuid value
    */
   public void setCqrGuid(java.lang.String cqrGuid) {
      _cqrGuid = cqrGuid;
   }
   /**
    * Returns the logType
    *
    * @return the logType
    */
   public java.lang.String getLogType() {
      return _logType;
   }

   /**
    * Sets the logType
    *
    * @param logType the new logType value
    */
   public void setLogType(java.lang.String logType) {
      _logType = logType;
   }
   /**
    * Returns the logContent
    *
    * @return the logContent
    */
   public java.lang.String getLogContent() {
      return _logContent;
   }

   /**
    * Sets the logContent
    *
    * @param logContent the new logContent value
    */
   public void setLogContent(java.lang.String logContent) {
      _logContent = logContent;
   }
   /**
    * Returns the logTime
    *
    * @return the logTime
    */
   public java.lang.String getLogTime() {
      return _logTime;
   }

   /**
    * Sets the logTime
    *
    * @param logTime the new logTime value
    */
   public void setLogTime(java.lang.String logTime) {
      _logTime = logTime;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCqlGuid() == null) {
         errors.add("cqlGuid", new ActionError("error.cqlGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
